package com.qf.service.impl;

import com.qf.pojo.Order;
import com.qf.service.OrderService;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

@Service
public class OrderServiceImpl implements OrderService {

    @Value("${server.port}")
    private Integer port;

    @Override
    public List<Order> findByUid(Integer uid) {
        //根据用户id，数据库查询用户的订单信息
        Order order1 = new Order(1,uid,1000d,"用户丁1-" + port);
        Order order2 = new Order(2,uid,2000d,"用户丁2-" + port);
        Order order3 = new Order(3,uid,3000d,"用户丁3-" + port);

        List<Order> orders = new ArrayList<>();
        orders.add(order1);
        orders.add(order2);
        orders.add(order3);

        return orders;
    }
}
